
//import QtQuick 1.0
import Qt 4.7

import SocketItems 1.0

Rectangle {
    id: main
    width: 360; height: 640
    color: "black"

    Text {
        id: kwhText
        font.pixelSize: 40
        color: "white"
        font.bold: true
        anchors.centerIn: parent
        text: "0.00 kWh"
    }

    ServerSocket {
        id: serverSocket

        onServerLog: {
            console.log(log);
        }
        onKwh: {
            console.log(value);
            kwhText.text = value + " kWh";
        }
    }

    Component.onCompleted: {
        serverSocket.enableClientMode();
        serverSocket.start();
    }

}
